var app = getApp();
var baseUrl = app.globalData.host;
Component({
  data: {
    formData :{},
    lists:[{}],
    listDate:{},
  },
  methods: {
    formInputChange(e) {
      const {field} = e.currentTarget.dataset;
      this.setData({
          [`listDate.${field}`]: e.detail.value
      })
    },
    formInputChanges(e) {
      let index = e.target.dataset.field
      let count = index.charAt(index.length-1);
      let name = index.substring(0,index.length-1)
      this.setData({
          [`formData[${[count]}].${name}`]: e.detail.value
      })
    },
    bindloanusageBlur: function(e) {
      this.setData({
          [`listDate.loanusageDesc`]: e.detail.value
      })
    },
    bindOtherAreaBlur:function(e){
      this.setData({
        [`listDate.othFamilyIncomeSourceDesc`]: e.detail.value
      })
    },
    submitForm: function() {
      var data = this.data.formData;
      var listData = this.data.listDate;
      console.info(data);
      console.info(listData);
    },

    onLoad: function(option) {
      var that = this;
      that.setData({
        custId:option.custId,
          [`formData.custId`]: option.custId
      });
      var data = that.data.formData;
  }
  }
});